package com.join.mybatis.base;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.function.Consumer;

/**
 * @author chengang
 */
public interface MyBaseService<S> extends IService<S> {

    public IPage<S> query(IPage<S> page, LinkedHashMap<String, Object> map) ;

    public IPage<S> queryByJoin(IPage<S> page, LinkedHashMap<String, Object> map);

    public IPage<S> queryByJoin(IPage<S> page, Consumer<QueryWrapper<S>> consumer, LinkedHashMap<String, Object> map) ;

    public IPage<S> queryByJoin(IPage<S> page,QueryWrapper<S> queryWrapper);

    public IPage<S> queryByJoin(IPage<S> page, Consumer<QueryWrapper<S>> consumer,QueryWrapper<S> queryWrapper) ;

    public <E extends IPage<S>> E page(E page, Wrapper<S> queryWrapper) ;

    public List<S> list(LinkedHashMap<String, Object> map, String... orderBy) ;

    public List<S> list(LinkedHashMap<String, Object> map, Boolean isAsc, String... orderBy) ;

    public List<S> listByJoin(LinkedHashMap<String, Object> map, String... orderBy) ;

    public List<S> listByJoin(QueryWrapper<S> queryWrapper, String... orderBy) ;

    public List<S> listByJoin(QueryWrapper<S> queryWrapper,Boolean isAsc, String... orderBy);

    public List<S> listByJoin(QueryWrapper<S> queryWrapper,Consumer<QueryWrapper<S>> consumer, Boolean isAsc,String... orderBy) ;


    public S getByIdJoin(String id) ;





}
